package com.dao;

import com.po.Lead;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface LeadRepository extends JpaRepository<Lead, Long>, JpaSpecificationExecutor<Lead> {

    Lead findAllById(Long id);

    @Query(value = "select * from o_lead where lead_state=5",nativeQuery = true)
    Page<Lead> findAllByState(Pageable pageable);
}
